package com.chencong.online.function;

import com.chencong.online.bean.UserBehaviorBean;
import org.apache.flink.api.common.functions.MapFunction;

/**
 * @Author chencong
 * @Description 将用户数据转换为javabean
 * @Date 6:50 下午 2021/12/19
 * @Param
 **/
public class UserBehaviorBeanMapFunc implements MapFunction<String, UserBehaviorBean> {
    @Override
    public UserBehaviorBean map(String s) throws Exception {
        String[] split = s.split(",");
        return new UserBehaviorBean(
               Long.valueOf(split[0]) ,
                Long.valueOf(split[1]),
                Integer.valueOf(split[2]),
                split[3],
                Long.valueOf(split[4])
                );
    }
}
